<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:insert="~{include :: header('修改位置变更')}" />
    <th:block th:insert="~{include :: datetimepicker-css}" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-history-edit" th:object="${devLocationHistory}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">设备ID：</label>
                    <div class="col-sm-8">
                        <input name="devId" th:field="*{devId}" class="form-control" type="text" required>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">原位置：</label>
                    <div class="col-sm-8">
                        <input name="oldLocation" th:field="*{oldLocation}" class="form-control" type="text" required>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">原纬度：</label>
                    <div class="col-sm-8">
                        <input name="oldLatitude" th:field="*{oldLatitude}" class="form-control" type="text" required>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">原经度：</label>
                    <div class="col-sm-8">
                        <input name="oldLongitude" th:field="*{oldLongitude}" class="form-control" type="text" required>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">新位置：</label>
                    <div class="col-sm-8">
                        <input name="newLocation" th:field="*{newLocation}" class="form-control" type="text" required>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">新纬度：</label>
                    <div class="col-sm-8">
                        <input name="newLatitude" th:field="*{newLatitude}" class="form-control" type="text" required>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">新经度：</label>
                    <div class="col-sm-8">
                        <input name="newLongitude" th:field="*{newLongitude}" class="form-control" type="text" required>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">变更时间：</label>
                    <div class="col-sm-8">
                        <div class="input-group date">
                            <input name="changeTime" th:value="${#dates.format(devLocationHistory.changeTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:insert="~{include :: footer}" />
    <th:block th:insert="~{include :: datetimepicker-js}" />
    <script th:inline="javascript">
        var prefix = ctx + "deviceManager/history";
        $("#form-history-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-history-edit').serialize());
            }
        }

        $("input[name='changeTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>